<template>
    <view class="dialogMain" v-if="isShowDialog" @touchmove.stop.prevent="">
        <view class="dialogContent">
            <view class="dialogtitle" style="margin-bottom: 15rpx;">请您认真阅读</view>
            <view class="dialogtitle">
                <text style="color: #FF0000" @click="NavTo('/pages/UserAgreement/UseragreeText')">《用户协议》</text>
                <text>、</text>
                <text style="color: #FF0000;margin-top: 5rpx;"
                      @click="NavTo('/pages/UserAgreement/userGetPrivacyPolicy?type=0')">《隐私政策》
                </text>
                <text>和</text>
                <text style="color: #FF0000;margin-top: 5rpx;"
                      @click="NavTo('/pages/UserAgreement/userGetPrivacyPolicy?type=1')">《外卖狮骑手注册及合作协议》
                </text>
            </view>

            <view class="dialine"></view>
            <view class="diabtnLayout">
                <view class="diabtnCancel" @click="onDisagreeClick">不同意</view>
                <view class="diabtnCommit" @click="onAgreeClick">同意</view>
            </view>
        </view>
    </view>
</template>

<script setup>
import {defineProps, defineEmits, ref, onMounted, getCurrentInstance} from "vue"
import {NavTo} from "@/utlis/uni_api";

let {proxy} = getCurrentInstance();
defineProps(["isShowDialog"]);
let emits = defineEmits(["disagree", "agree"])

const onDisagreeClick = () => {
    emits("disagree")
}

const onAgreeClick = () => {
    emits("agree")
}

</script>

<style scoped lang="scss">
.dialogMain {
    width: 100%;
    height: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.dialogContent {
    width: 70%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background-color: #FFFFFF;
    border-radius: 30rpx;
    padding: 30rpx 0 26rpx;
}

.dialogtitle {
    font-size: 30rpx;
    letter-spacing: 2rpx;
    font-weight: 400;
    color: #333333;
    padding: 0 32rpx;
    text-align: justify;
}

.content {
    width: 100%;
    padding: 20rpx 38rpx 0;
    flex: 1;
    box-sizing: border-box;
    font-size: 30rpx;
    font-weight: 400;
    color: #3D3D3D;
    text-align: center;
}

.diabtnLayout {
    display: flex;
    align-items: center;
    justify-content: center;
}

.diabtnCancel {
    width: 162rpx;
    background: #AAAAAA;
    border-radius: 40rpx;
    font-size: 30rpx;
    font-weight: 400;
    color: #FFFFFF;
    padding: 10rpx 0 10rpx;
    letter-spacing: 1rpx;
    height: 42rpx;
    line-height: 42rpx;
    text-align: center;
    margin-right: 50rpx;
}

.diabtnCommit {
    width: 162rpx;
    background: $color_def;
    border-radius: 40rpx;
    font-size: 30rpx;
    font-weight: 400;
    color: #FFFFFF;
    padding: 10rpx 0 10rpx;
    letter-spacing: 1rpx;
    height: 42rpx;
    line-height: 42rpx;
    text-align: center;
}

.dialine {
    width: 100%;
    border-bottom: 1rpx solid rgba(170, 170, 170, 0.2);
    margin: 30rpx 0 24rpx;
}
</style>